@extends('layouts.app')

@section('content')
    <div class="fix-top-bar"></div>
    <div class="container main-container m-t-100" style="min-height: 1150px">
        @if (session('status'))
            <div class="alert alert-success">
                <a href="#" class="close" data-dismiss="alert">&times;</a>
                <strong>通知：</strong>{{session('status')}}
            </div>
        @endif
        <div class="row font">
            <div class="col-md-3">
                @yield('lift-contaier')
            </div>
            <div class="main-col col-md-9 left-col" style="background-color: white;border: 1px solid #eee">
                @yield('right-contaier')
            </div>
        </div>
    </div>
    <div class="m-t-10 w100 pull-left" style="background-color:  white">
        @include('include.bottom.info')
    </div>
@endsection

@section('js')
    <script>
        $(document).ready(function () {
            $('body').css("background-color", "whitesmoke");
            $('body').css("height", "10px");
        });
        function getImgURL(node) {
            var imgURL = "";
            try{
                var file = null;
                if(node.files && node.files[0] ){
                    file = node.files[0];
                }else if(node.files && node.files.item(0)) {
                    file = node.files.item(0);
                }
                try{
                    imgURL =  file.getAsDataURL();
                }catch(e){
                    imgRUL = window.URL.createObjectURL(file);
                }
            }catch(e){
                if (node.files && node.files[0]) {
                    var reader = new FileReader();
                    reader.onload = function (e) {
                        imgURL = e.target.result;
                    };
                    reader.readAsDataURL(node.files[0]);
                }
            }
            creatImg(imgRUL);
            return imgURL;
        }
        function creatImg(imgRUL){   //根据指定URL创建一个Img对象
            console.log(imgRUL);
            $('#preview-img').attr('src', imgRUL);
        }
    </script>
@endsection